import os

import xlrd


class LoginData():
    x = os.getcwd()
    xl = xlrd.open_workbook(f'{x}/测试数据.xls')
    sheet = xl.sheet_by_index(0)
    right = []
    wrongname = []
    wrongpwd = []
    for i in range(1, 3):
        row = sheet.row_values(i)
        a = row[0]
        b = str(row[1]).split('.')[0]
        c = row[2]
        right.append([a, b, c])
    for i in range(3, 5):
        row = sheet.row_values(i)
        a = row[0]
        b = str(row[1]).split('.')[0]
        c = row[2]
        wrongname.append([a, b, c])
    for i in range(5, 7):
        row = sheet.row_values(i)
        a = row[0]
        b = str(row[1]).split('.')[0]
        c = row[2]
        wrongpwd.append([a, b, c])


class SignUpDate():
    x = os.getcwd()
    xl = xlrd.open_workbook(f'{x}/测试数据.xls')
    sheet = xl.sheet_by_index(1)
    right = []
    wrongname = []
    wrongpwd = []
    row = sheet.row_values(1)
    right.append([row[0], row[1], row[2], row[3]])
    row = sheet.row_values(2)
    wrongname.append([row[0], row[1], row[2], row[3]])
    row = sheet.row_values(3)
    wrongpwd.append([row[0], row[1], row[2], row[3]])


class Buy_LingQian():
    x = os.getcwd()
    xl = xlrd.open_workbook(f'{x}/测试数据.xls')
    sheet = xl.sheet_by_index(2)
    right = []
    wrong_paywd = []
    no_money = []
    no_card = []
    row = sheet.row_values(1)
    b = str(row[1]).split('.')[0]
    c = str(row[2]).split('.')[0]
    right.append([row[0], b, c, row[3]])

    row = sheet.row_values(2)
    c = str(row[2]).split('.')[0]
    wrong_paywd.append([row[0], b, c, row[3]])

    row = sheet.row_values(3)
    c = str(row[2]).split('.')[0]
    no_money.append([row[0], b, c, row[3]])

    row = sheet.row_values(4)
    c = str(row[2]).split('.')[0]
    no_card.append([row[0], b, c, row[3]])


class Pay():
    x = os.getcwd()
    xl = xlrd.open_workbook(f'{x}/测试数据.xls')
    sheet = xl.sheet_by_index(3)
    no_paywd = []
    default1 = []
    default2 = []
    row = sheet.row_values(1)
    b = str(row[1]).split('.')[0]
    c = str(row[2]).split('.')[0]
    no_paywd.append([row[0], b, c, row[3]])
    row = sheet.row_values(2)
    c = str(row[2]).split('.')[0]
    default1.append([row[0], b, c, row[3]])
    row = sheet.row_values(3)
    c = str(row[2]).split('.')[0]
    default2.append([row[0], b, c, row[3]])
    print(no_paywd)


class borrow():
    x = os.getcwd()
    xl = xlrd.open_workbook(f'{x}/测试数据.xls')
    sheet = xl.sheet_by_index(4)
    zhengchang = []
    shenpi = []
    nocard = []
    big= []
    small= []
    maxtime= []
    time= []
    row = sheet.row_values(1)
    b = str(row[1]).split('.')[0]
    zhengchang.append([row[0], b, row[2]])
    row = sheet.row_values(2)
    shenpi.append([row[0], b, row[2]])
    row = sheet.row_values(3)
    nocard.append([row[0], b, row[2]])
    row = sheet.row_values(4)
    big.append([row[0], b, row[2]])
    row = sheet.row_values(5)
    small.append([row[0], b, row[2]])
    row = sheet.row_values(6)
    maxtime.append([row[0], b, row[2]])
    row = sheet.row_values(7)
    time.append([row[0], b, row[2]])